//
//  BankListVC.m
//  ZZLC
//
//  Created by 杨春至 on 2017/12/15.
//  Copyright © 2017年 ZhongZeng. All rights reserved.
//

#import "BankListVC.h"

@interface BankListVC ()<UITableViewDelegate,UITableViewDataSource>

@property (nonatomic,strong) NSMutableArray *dataSource;

@property (nonatomic,strong) UITableView *tableView;

@end

@implementation BankListVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"银行卡列表";
    [self loadData];
    [self configUI];
}
- (void)loadData{
    self.dataSource = @[@"",@"",@"",@"",@"",@"",@""].mutableCopy;
}
- (void)configUI{
    [self.view addSubview:self.tableView];
    
}
- (void)viewDidLayoutSubviews{
    [_tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(self.view);
    }];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
//    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"bankcell" forIndexPath:indexPath];
    UITableViewCell *cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"bankcell"];
    cell.imageView.backgroundColor = [UIColor redColor];
    cell.imageView.image = UIImageMake(@"meSelect");
    cell.textLabel.text = @"中国银行";
    cell.detailTextLabel.text = @"单笔5w/日单30w";
    return cell;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
    UIView *headView = [UIView new];
    headView.backgroundColor = [UIColor qmui_colorWithHexString:@"#F8F8FF"];
    UILabel *lb = [[UILabel alloc]initWithFont:[UIFont systemFontOfSize:13] textColor:RGBCOLOR(128, 128, 128)];
    lb.text = @"支持银行及限额";
    [lb sizeToFit];
    lb.center = CGPointMake(KWidth/2, 30/2);
    lb.left = 15;
    [headView addSubview:lb];
    return headView;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
    return self.dataSource.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
    return 50;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
    return 30;
}
- (UITableView *)tableView{
    if (!_tableView) {
        _tableView = [[UITableView alloc]init];
        _tableView.delegate = self;
        _tableView.dataSource = self;
        [_tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:@"bankcell"];
    }
    return _tableView;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

@end
